/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package client.gui.controls;

import javax.swing.event.TableModelListener;
import javax.swing.table.TableModel;

/**
 *
 * @author Administrator
 */
public class GameTableModel implements TableModel{
    
    private Object[][] data;
    String[] kolomNamen = {"Spel Naam", "Type", "Oprichter", "Spelers", "Paswoord"};
    Class[] kolomKlassen = {String.class,String.class,String.class,String.class,Boolean.class};

    public int getRowCount() {
        return data.length;
    }

    public int getColumnCount() {
        return kolomNamen.length;
    }

    public String getColumnName(int columnIndex) {
        return kolomNamen[columnIndex];
    }

    public Class<?> getColumnClass(int columnIndex) {
        return kolomKlassen[columnIndex];
    }

    public boolean isCellEditable(int rowIndex, int columnIndex) {
        return false;
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        return data[rowIndex][columnIndex];
    }

    public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
        data[rowIndex][columnIndex] = aValue;
    }

    public void addTableModelListener(TableModelListener l) {
    }

    public void removeTableModelListener(TableModelListener l) {
    }

    public Object[][] getData() {
        return data;
    }

    public void setData(Object[][] data) {
        this.data = data;
    }

}
